/*** Eclipse Class Decompiler plugin, copyright (c) 2012 Chao Chen (cnfree2000@hotmail.com) ***/
package com.qihoopp.qcoinpay;

import com.qihoopp.framework.LogUtil;
import java.math.BigInteger;
import java.security.MessageDigest;

public final class dc {
    public static String a(String paramString) {
        try {
            int i = (paramString = paramString).length();
            paramString = paramString.getBytes("UTF-16LE");
            LogUtil.e("----", "b = " + a(paramString));
            Object localObject = new byte[i];
            int k = 0;
            int l = 0;
            while (k < paramString.length) {
                if ((paramString[k] != -1) && (paramString[k] != -2)) {
                    localObject[l] = paramString[k];
                    if (++l == i)
                        break;
                }
                k += 2;
            }
            LogUtil.e("----", "source = " + a(localObject));
            paramString = (String) localObject;
            char[] arrayOfChar1 = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' };
            (localObject = MessageDigest.getInstance("MD5")).update(paramString);
            int j;
            char[] arrayOfChar2 = new char[(j = (paramString = ((MessageDigest) localObject).digest()).length) * 2];
            l = 0;
            for (int i1 = 0; i1 < j; ++i1) {
                int i2 = paramString[i1];
                arrayOfChar2[(l++)] = arrayOfChar1[(i2 >>> 4 & 0xF)];
                arrayOfChar2[(l++)] = arrayOfChar1[(i2 & 0xF)];
            }
            return new String(arrayOfChar2);
        } catch (Exception localException) {
            localException.printStackTrace();
        }
        return ((String) null);
    }

    private static String a(byte[] paramArrayOfByte) {
        if (paramArrayOfByte == null)
            return "";
        if (paramArrayOfByte.length == 0)
            return "";
        byte[] arrayOfByte2 = new byte[paramArrayOfByte.length * 2];
        for (int i = 0; i < arrayOfByte2.length; ++i)
            arrayOfByte2[i] = 48;
        byte[] arrayOfByte1;
        (arrayOfByte1 = new byte[paramArrayOfByte.length + 1])[0] = 0;
        System.arraycopy(paramArrayOfByte, 0, arrayOfByte1, 1, paramArrayOfByte.length);
        paramArrayOfByte = new BigInteger(arrayOfByte1).toString(16).getBytes();
        int k = arrayOfByte2.length - paramArrayOfByte.length;
        int j = paramArrayOfByte.length;
        System.arraycopy(paramArrayOfByte, 0, arrayOfByte2, k, j);
        return new String(arrayOfByte2);
    }
}